package com.yifan.spring.service;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.locks.ReentrantLock;


/**
 * @Author YIFan
 * @Date 2021/4/23 11:22
 * @Version 1.0
 */
@Component
public class UserService implements InitializingBean {

    private OrderService orderService;

    public UserService(OrderService orderService3) {
        this.orderService = orderService3;
    }



    // 这个对象是想从数据中查出user对象然后赋值给这个 defaultUser  那么如何实现？
    private User defaultUser;


    @Override
    public void afterPropertiesSet() throws Exception {
        // 这里可以 进行mysql操作进行赋值
        // ...
        defaultUser = new User();

    }

//    @Transactional  需要mybatis pom包
    public void test(){
        System.out.println("test");
    }
}
